@echo off

REM SHA1 sums of files required
REM 9988723269367fb44ef83f627186a1c88cf7877e decoder.4
REM 30002643d08ed983a6701a7c4b5ee74a2f4a1adb decoder.6
REM f6d60e26c209c1df2cc01ac07ad5559daa1b7118 robotron.sb1
REM 4d6e82bc29f49100f7751ccfc6a9ff35695b84b3 robotron.sb2
REM 06a8c8dd0b4726eb7f0bb0e89c8533931d75fc1c robotron.sb3
REM aaf89c19fd8f4e8750717169eb1af476aef38a5e robotron.sb4
REM 79b4680ce19bd28882ae823f0e7b293af17cbb91 robotron.sb5
REM f76ec5432a7939b33a27be1c6855e2dbe6d9fdc8 robotron.sb6
REM 06eae5138254723819a5e93cfd9e9f3285fcddf5 robotron.sb7
REM 7ae38a609ed9a6f62ca003cab719740ed7651b7c robotron.sb8
REM fd9d75b866f0ebbb723f84889337e6814496a103 robotron.sb9
REM d426a50e75dabe936de643c83a548da5e399331c robotron.sba
REM f8c6cbe3688f256f41a121255fc08f575f6a4b4f robotron.sbb
REM fad7cea868ebf17347c4bc5193d647bbd8f9517b robotron.sbc
REM 15afefef11bfc3ab78f61ab046701db78d160ec3 robotron.snd

set rom_path_src=..\roms\robotron
set rom_path_dst=..\build
set romgen_path=..\tools

mkdir %rom_path_dst%
REM generate RAMB structures for larger ROMS

REM soundcpu
%romgen_path%\romgen %rom_path_src%\robotron.snd SND_ROM_0F    12 l r e > %rom_path_dst%\SND_ROM_0F.vhd

REM decoders
%romgen_path%\romgen %rom_path_src%\decoder.4    DECODER_4      9 a     > %rom_path_dst%\DEC_4.vhd
%romgen_path%\romgen %rom_path_src%\decoder.6    DECODER_6      9 a     > %rom_path_dst%\DEC_6.vhd

REM maincpu
%romgen_path%\romgen %rom_path_src%\robotron.sba CPU_ROM_0D    12 l r e > %rom_path_dst%\CPU_ROM_0D.vhd
%romgen_path%\romgen %rom_path_src%\robotron.sbb CPU_ROM_0E    12 l r e > %rom_path_dst%\CPU_ROM_0E.vhd
%romgen_path%\romgen %rom_path_src%\robotron.sbc CPU_ROM_0F    12 l r e > %rom_path_dst%\CPU_ROM_0F.vhd
%romgen_path%\romgen %rom_path_src%\robotron.sb1 CPU_ROM_10    12 l r e > %rom_path_dst%\CPU_ROM_10.vhd
%romgen_path%\romgen %rom_path_src%\robotron.sb2 CPU_ROM_11    12 l r e > %rom_path_dst%\CPU_ROM_11.vhd
%romgen_path%\romgen %rom_path_src%\robotron.sb3 CPU_ROM_12    12 l r e > %rom_path_dst%\CPU_ROM_12.vhd
%romgen_path%\romgen %rom_path_src%\robotron.sb4 CPU_ROM_13    12 l r e > %rom_path_dst%\CPU_ROM_13.vhd
%romgen_path%\romgen %rom_path_src%\robotron.sb5 CPU_ROM_14    12 l r e > %rom_path_dst%\CPU_ROM_14.vhd
%romgen_path%\romgen %rom_path_src%\robotron.sb6 CPU_ROM_15    12 l r e > %rom_path_dst%\CPU_ROM_15.vhd
%romgen_path%\romgen %rom_path_src%\robotron.sb7 CPU_ROM_16    12 l r e > %rom_path_dst%\CPU_ROM_16.vhd
%romgen_path%\romgen %rom_path_src%\robotron.sb8 CPU_ROM_17    12 l r e > %rom_path_dst%\CPU_ROM_17.vhd
%romgen_path%\romgen %rom_path_src%\robotron.sb9 CPU_ROM_18    12 l r e > %rom_path_dst%\CPU_ROM_18.vhd

echo done
pause
